/**
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.kopsox.environment;

import org.kopsox.data.ValueDescriptor;
import org.kopsox.util.comm.ObserverTreeSet;
import org.kopsox.util.validation.ValidatorSet;

/**
 * @author Konrad Renner - 14.10.2010
 *
 */
public interface ValueEnvironment extends KopsoxEnvironment {

	/**
	 * Gets a ValueDescriptor-Object from the Environment<br>
	 * 'name' is the name of the value.<br>
	 * 'namespace' depends on the implementation of this interface(for e.g. the name of the module from the application)<br>
	 * If it cannot be loaded, null is returned
	 * 
	 * @param name
	 * @param namespace
	 * @return ValueDescriptor
	 */
	public ValueDescriptor getValueDescription(final String name,final String namespace);
	
	/**
	 * Gets the initial value from an Value.<br>
	 * If it cannot be loaded, null is returned
	 * 
	 * @param name
	 * @param namespace
	 * @return String
	 */
	public String getInitialDataFromValue(final String name,final String namespace);
	
	/**
	 * Gets the name of the type from an Value (e.g. 'BIGDECIMAL').<br>
	 * If it cannot be loaded, null is returned
	 * 
	 * @param name
	 * @param namespace
	 * @return String
	 */
	public String getTypeNameFromValue(final String name,final String namespace);
	
	/**
	 * Gets a Set of Validators for a value from the Environment<br>
	 * 'name' is the name of the value.<br>
	 * 'namespace' depends on the implementation of this interface(for e.g. the name of the module from the application)<br>
	 * If no Validators can be found, an empty ValidatorSet is returned.
	 * 
	 * @param name
	 * @param namespace
	 * @return ValueDescriptor
	 */
	public ValidatorSet getValidatorsForValue(final String name,final String namespace);
	
	/**
	 * Gets a Set of Observers for a value from the Environment<br>
	 * 'name' is the name of the value.<br>
	 * 'namespace' depends on the implementation of this interface(for e.g. the name of the module from the application)<br>
	 * If no Observers can be found, an empty ObserverSet is returned.
	 * 
	 * @param name
	 * @param namespace
	 * @return ValueDescriptor
	 */
	public ObserverTreeSet getObserversForValue(final String name,final String namespace);
}
